package com.entity;

import java.io.Serializable;
import java.util.List;

/**
 * @author 
 */
public class News implements Serializable {
    private String nid;

    private String ntitle;

    private String nconent;

    private String nimg;

    private String nhref;

    private Integer norder;


    public List<Admin> getAdmins() {
        return admins;
    }

    public void setAdmins(List<Admin> admins) {
        this.admins = admins;
    }

    private List<Admin> admins; //spring 管理mybatis帮我们找到关联的学生

    private static final long serialVersionUID = 1L;

    public String getNid() {
        return nid;
    }

    public void setNid(String nid) {
        this.nid = nid;
    }

    public String getNtitle() {
        return ntitle;
    }

    public void setNtitle(String ntitle) {
        this.ntitle = ntitle;
    }

    public String getNconent() {
        return nconent;
    }

    public void setNconent(String nconent) {
        this.nconent = nconent;
    }

    public String getNimg() {
        return nimg;
    }

    public void setNimg(String nimg) {
        this.nimg = nimg;
    }

    public String getNhref() {
        return nhref;
    }

    public void setNhref(String nhref) {
        this.nhref = nhref;
    }

    public Integer getNorder() {
        return norder;
    }

    public void setNorder(Integer norder) {
        this.norder = norder;
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        News other = (News) that;
        return (this.getNid() == null ? other.getNid() == null : this.getNid().equals(other.getNid()))
            && (this.getNtitle() == null ? other.getNtitle() == null : this.getNtitle().equals(other.getNtitle()))
            && (this.getNconent() == null ? other.getNconent() == null : this.getNconent().equals(other.getNconent()))
            && (this.getNimg() == null ? other.getNimg() == null : this.getNimg().equals(other.getNimg()))
            && (this.getNhref() == null ? other.getNhref() == null : this.getNhref().equals(other.getNhref()))
            && (this.getNorder() == null ? other.getNorder() == null : this.getNorder().equals(other.getNorder()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getNid() == null) ? 0 : getNid().hashCode());
        result = prime * result + ((getNtitle() == null) ? 0 : getNtitle().hashCode());
        result = prime * result + ((getNconent() == null) ? 0 : getNconent().hashCode());
        result = prime * result + ((getNimg() == null) ? 0 : getNimg().hashCode());
        result = prime * result + ((getNhref() == null) ? 0 : getNhref().hashCode());
        result = prime * result + ((getNorder() == null) ? 0 : getNorder().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", nid=").append(nid);
        sb.append(", ntitle=").append(ntitle);
        sb.append(", nconent=").append(nconent);
        sb.append(", nimg=").append(nimg);
        sb.append(", nhref=").append(nhref);
        sb.append(", norder=").append(norder);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}